﻿
App
.config([
   '$stateProvider', '$locationProvider', '$urlRouterProvider', 'RouteHelpersProvider',
    function ($stateProvider, $locationProvider, $urlRouterProvider, helper) {
        'use strict';
        $stateProvider
            .state('shop', {
                abstract: true,
                url: '/shop',
                templateUrl: '/pages/shop.html',
            })

                    .state('shop.index', {
                        url: '/',
                        title: '首页',
                        templateUrl: '/Home/Index',
                        resolve: helper.resolveFor('carousel')
                    })
            .state('shop.productdetail', {
                url: '/productdetail?:sku:activityId',
                title: '商品详情',
                templateUrl: '/Product/ProductDetail',
                resolve: helper.resolveFor('carousel')
            })
            .state('shop.productexchangedetail', {
                url: '/productexchangedetail?:Id',
                title: '积分商品详情',
                templateUrl: '/Product/ProductExchangeDetail',
                resolve: helper.resolveFor('carousel')
            })
            .state('shop.cart', {
                url: '/cart',
                title: '购物车',
                templateUrl: '/Product/ShopCart'
            })
            .state('shop.favorite', {
                url: '/favorite',
                title: '我的收藏',
                templateUrl: '/Product/MyFavorite'
            })
            .state('shop.productlist', {
                url: '/productlist?:keywords:fcId:scId',
                title: '商品列表',
                templateUrl: '/Product/ProductList'
            })
            .state('shop.searchindex', {
                url: '/searchindex',
                title: '搜索',
                templateUrl: '/Product/SearchIndex'
            })
            .state('shop.search', {
                url: '/search',
                title: '搜索输入',
                templateUrl: '/Product/Search'
            })



            //活动模块
            .state('activity', {
                abstract: true,
                url: '/activity',
                templateUrl: '/pages/shop.html',
            })

             .state('activity.activityinfo', {
                 url: '/activity/activityinfo/:Id',
                 title: '一分钱活动详情',
                 templateUrl: '/Activity/ActivityInfo'
             })

               .state('activity.activityteaminfo', {
                   url: '/activity/activityteaminfo/:Id',
                   title: '一分钱团详情',
                   templateUrl: '/Activity/ActivityTeamInfo'
               })

                 .state('activity.myactivitylist', {
                     url: '/activity/myactivitylist',
                     title: '我的一分钱活动列表',
                     templateUrl: '/Activity/MyActivityList'
                 })


               .state('activity.dropgroupinfo', {
                   url: '/dropgroup/dropgroupinfo/:Id',
                   title: '降拼活动详情',
                   templateUrl: '/DropGroup/DropGroupInfo'
               })

               .state('activity.groupheadlist', {
                   url: '/dropgroup/groupheadlist/:Id',
                   title: '降拼团列表',
                   templateUrl: '/DropGroup/GroupHeadList'
               })

               .state('activity.groupheadinfo', {
                   url: '/dropgroup/groupheadinfo/:Id',
                   title: '降拼团详情',
                   templateUrl: '/DropGroup/GroupHeadInfo'
               })

              .state('activity.mydropgrouporderlist', {
                  url: '/dropgroup/mydropgrouporderlist',
                  title: '我的降拼团订单',
                  templateUrl: '/DropGroup/MyDropGroupOrderList'
              })

             .state('activity.spikelist', {
                 url: '/spikelist',
                 title: '限时秒杀',
                 templateUrl: '/Activity/SpikeList',
                 resolve: helper.resolveFor('carousel')
             })
            .state('activity.specialtopic', {
                url: '/specialtopic/:Id',
                title: '专题活动',
                templateUrl: '/Activity/SpecialTopic'
            })
           .state('activity.index', {
               url: '/index',
               title: '一分钱活动',
               templateUrl: '/Activity/Index',
               resolve: helper.resolveFor('carousel')
           })

             .state('activity.dropgroupindex', {
                 url: '/dropgroupindex',
                 title: '降价拼团',
                 templateUrl: '/DropGroup/DropGroupIndex',
                 resolve: helper.resolveFor('carousel')
             })
        .state('activity.myactivity', {
            url: '/myactivity',
            title: '我的活动',
            templateUrl: '/Activity/MyActivity',
            resolve: helper.resolveFor('slick')
        })
        .state('activity.role', {
            url: '/role',
            title: '活动规则',
            templateUrl: '/Activity/Role',
            resolve: helper.resolveFor('slick')
        })

             .state('activity.role1', {
                 url: '/role1',
                 title: '活动规则',
                 templateUrl: '/Activity/Role1',
                 resolve: helper.resolveFor('slick')
             })
            //积分抽奖
        .state('draw', {
            abstract: true,
            url: '/draw',
            templateUrl: '/pages/shop.html',
        })
        .state('draw.index', {
            url: '/index?:drawId:tId',
            title: '积分抽奖',
            templateUrl: function ($routeParams) { return '/Draw/Index?drawId=' + $routeParams.drawId + "&tId=" + $routeParams.tId; },
            resolve: helper.resolveFor('slick')
        })
        .state('draw.list', {
            url: '/list',
            title: '奖品列表',
            templateUrl: '/Draw/RecordList',
            resolve: helper.resolveFor('slick')
        })
             .state('draw.setAddress', {
                 url: '/draw/setAddress?:Id',
                 title: '设置收货地址',
                 templateUrl: '/Draw/SetAddress',
                 resolve: helper.resolveFor('slick')
             })
            .state('shop.wx', {
                url: '/wx?:returnUrl',
                title: '',
                templateUrl: function ($routeParams) { return '/Wx/Index?returnUrl=' + $routeParams.returnUrl; },
                resolve: helper.resolveFor('slick')
            })

         .state('shop.callback', {
             url: '/callback?:returnUrl',
             title: '',
             templateUrl: function ($routeParams) { return '/Wx/Callback?returnUrl=' + $routeParams.returnUrl; },
             resolve: helper.resolveFor('slick')
         })
        .state('user', {//会员中心模块
            abstract: true,
            url: '/user',
            templateUrl: '/pages/shop.html',
        })
         .state('user.index', {
             url: '/index',
             title: '会员中心',
             templateUrl: '/UserCenter/Index',
             resolve: helper.resolveFor('slick')
         })
        .state('user.sign', {
            url: '/sign',
            title: '会员签到',
            templateUrl: '/UserCenter/Sign',
            resolve: helper.resolveFor('carousel')
        })
        .state('user.coupon', {
            url: '/coupon',
            title: '我的优惠券',
            templateUrl: '/UserCenter/MyCoupon',
            resolve: helper.resolveFor('slick')
        })
        .state('user.pointDetail', {
            url: '/pointDetail',
            title: '积分兑换记录',
            templateUrl: '/UserCenter/PointDetail',
            resolve: helper.resolveFor('slick')
        })
            .state('user.pointOrder', {
                url: '/pointOrder',
                title: '积分订单',
                templateUrl: '/UserCenter/PointOrder',
                resolve: helper.resolveFor('slick')
            })
        .state('user.address', {
            url: '/address',
            title: '我的地址',
            templateUrl: '/UserCenter/MyAddress',
            resolve: helper.resolveFor('slick')
        })
        .state('user.addressinfo', {
            url: '/addressinfo?:Id',
            title: '积分兑换记录',
            templateUrl: '/UserCenter/AddressInfo',
            resolve: helper.resolveFor('slick')
        })
        .state('user.info', {
            url: '/info',
            title: '会员信息',
            templateUrl: '/UserCenter/MemberInfo',
            resolve: helper.resolveFor('slick')
        })
        .state('user.balance', {
            url: '/balance',
            title: '我的余额',
            templateUrl: '/UserCenter/BalanceDetail',
            resolve: helper.resolveFor('slick')
        })
        .state('user.order', {
            url: '/order?:status',
            title: '我的订单',
            templateUrl: '/UserCenter/MyOrder',
            resolve: helper.resolveFor('slick')
        })
        .state('user.recharge', {
            url: '/recharge',
            title: '充值',
            templateUrl: '/UserCenter/Recharge',
            resolve: helper.resolveFor('slick')
        })
        .state('shop.pointorder', {
            url: '/submitpoint?:id',
            title: '提交订单',
            templateUrl: '/Order/PointOrder',
            resolve: helper.resolveFor('slick')
        })
         .state('shop.actorder', {
             url: '/actorder?:activityId:groupId',
             title: '提交订单',
             templateUrl: '/Order/ActOrder',
             resolve: helper.resolveFor('slick')
         })
        .state('user.addcomment', {
            url: '/addcomment?:orderId',
            title: '评论',
            templateUrl: '/Product/AddComment',
            resolve: helper.resolveFor('angularFileUpload')
        })

            .state('shop.orderconfirm', {
                url: '/submit?:cartids:specId:num:activityId:activityType:groupId',
                title: '提交订单',
                templateUrl: '/Order/OrderSubmit',
                resolve: helper.resolveFor('slick')
            })
        .state('shop.orderpay', {
            url: '/orderpay?:id',
            title: '支付',
            templateUrl: '/OrderPayment/Index',
            resolve: helper.resolveFor('slick')
        })
        .state('shop.recharge', {
            url: '/recharge?:id',
            title: '支付',
            templateUrl: '/OrderPayment/Recharge',
            resolve: helper.resolveFor('slick')
        })
        .state('shop.success', {
            url: '/success?:id',
            title: '支付成功',
            templateUrl: '/Order/Success',
            resolve: helper.resolveFor('slick')
        })
        .state('shop.actsuccess', {
            url: '/actsuccess?:id',
            title: '支付成功',
            templateUrl: '/Order/ActSuccess',
            resolve: helper.resolveFor('slick')
        })
        .state('shop.orderdetail', {
            url: '/orderdetail?:id',
            title: '订单详情',
            templateUrl: '/Order/OrderDetail',
            resolve: helper.resolveFor('slick')
        })
            .state('shop.return', {
                url: '/return?:id',
                title: '申请退货',
                templateUrl: '/Order/ReturnGoods',
                resolve: helper.resolveFor('angularFileUpload')
            })
         .state('shop.coupon', {
             url: '/coupon',
             title: '优惠券',
             templateUrl: '/Coupon/Index',
             resolve: helper.resolveFor('carousel')
         })
        .state('shop.test', {
            url: '/test',
            title: '测试',
            templateUrl: '/test/Index'
        })
        ;
    }
]
    );